﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace _1041448_DH_Utilities
{
    public class MString
    {
        public static int GetFrequenceSpaceByCharacter(string source){
            // Find one or multi space in source
            return Regex.Matches(source, "\\s+").Count;
        }

        public static string CleanSpaceBySource(string source){
            return Regex.Replace(source, "\\s{3,}", "  ");
        }

        public static int CountCharacterByString (string source){
            return source.Length;
        }
    }
}
